function L = BetaLikelihoodTobit(x, rStock, rIndexU, rIndexD , rIndexN, limit)
    
    %x = [beta sigma]

    [nn mn] = size(rStock);
    [nd md] = size(rIndexD);
    [nu mu] = size(rIndexU);
    
    L = 0;
  
    L = L + sum(log(normpdf((rStock - rIndexN * x(1))/sqrt(x(2)), 0, 1)/sqrt(x(2))));
 
    L = L + sum(log(normcdf((-limit - rIndexD * x(1))/sqrt(x(2)), 0, 1)));

    L = L + sum(log(1 - normcdf((limit - rIndexU * x(1))/sqrt(x(2)), 0, 1)));
  
end